<?php
class NameComponent extends Component {
	var $controller;
	
	function startup(&$controller) {
		$this->controller =& $controller;
		$this->controller->set('name', $this);
	}
	
	function getNickname($userID)
	{
		App::import('Model', 'User');
		$name = new User();
		$name->recursive = -1;
		$user = $name->findByIdAndStatus($userID, 'active');
		return $user['User']['nickname'];
	}

}
?>
